<div class="db_left bl">
    <?php $this->load->view('medical/object/side_block'); ?>
</div>
    <div class="db_right bl">
        <div class="std_header auto_height">
            <div class="left">
                <strong><?php echo $module['title']; ?></strong>
            </div>
        </div>
        <div id="object_management">
            <form id="frm_object_edit" method="POST" action="<?php echo $save_action; ?>">
                <?php $this->load->view('medical/object/message'); ?>
                <input id="entity_id" type="hidden" name="id" value="<?php echo isset($object->id) ? $object->id : '' ; ?>" />
                <div class="clearfix auto_height mb_10 mt_10">
                    <button class="gray_btn " type="button" onclick="window.location = '<?php echo site_url('admin/medical/object/index', true); ?>'"><span>Về danh sách</span></button>
                    <button class="gray_btn" type="button" onclick="admin_medical_object.submit_object();"><span>Lưu lại</span></button>
                    <button class="gray_btn" type="reset"><span>Nhập lại</span></button>
                    <?php if (isset($object->id) && $has_privilege_delete) :?>
                    <button class="gray_btn delete_btn" type="button" action="<?php echo site_url('admin/medical/object/delete/id/' . $object->id, true); ?>" message="Bạn muốn xóa đối tượng này?" onclick="btn_util.active_delete(this)"><span>Xóa đối tượng</span></button>
                    <?php endif; ?>
                </div>
                <div class="form_block">
                    <div class="block_header">
                        Thông tin căn bản
                    </div>
                    <div class="block_content">
                        <table cellpadding="0px" cellspacing="0px">
                            <tr>
                                <td class="frm_label">Tên đối tượng(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input required obj_name" name="data[name]"  value="<?php echo get_field($object, 'name'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Bí danh</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input " name="data[alter_name]"  value="<?php echo get_field($object, 'alter_name'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Tiền tố</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input " name="data[title]"  value="<?php echo get_field($object, 'title'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Độ tuổi từ(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input required obj_age_from" name="data[age_from]"  value="<?php echo get_field($object, 'age_from'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Độ tuổi đến(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input required obj_age_to" name="data[age_to]"  value="<?php echo get_field($object, 'age_to'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Đơn vị tuổi</td>
                                <td class="frm_field">
                                    <select class="std_input" name="data[unit]">
                                        <option value="1" <?php if (isset($object->unit) && $object->unit == 1) :?> selected="selected" <?php endif; ?>>Năm</option>
                                        <option value="2" <?php if (isset($object->unit) && $object->unit == 2) :?> selected="selected" <?php endif; ?>>Tháng</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Giới tính</td>
                                <td class="frm_field">
                                    <select class="std_input" name="data[gender]">
                                        <option value="1" <?php if (isset($object->gender) && $object->gender == 1) :?> selected="selected" <?php endif; ?>>Nam</option>
                                        <option value="2" <?php if (isset($object->gender) && $object->gender == 2) :?> selected="selected" <?php endif; ?>>Nữ</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Vị trí</td>
                                <td class="frm_field">
                                    <select class="std_input" name="data[pos_visible]">
                                        <option value="1" <?php if (isset($object->pos_visible) && $object->pos_visible == 1) :?> selected="selected" <?php endif; ?>>Toàn trang</option>
                                        <option value="2" <?php if (isset($object->pos_visible) && $object->pos_visible == 2) :?> selected="selected" <?php endif; ?>>Admin</option>
                                    </select>
                                </td>
                            </tr>

                            <tr>
                                <td class="frm_label">Hiển thị</td>
                                <td class="frm_field">
                                    <select class="std_input" name="data[is_hidden]">
                                        <option value="1" <?php if (isset($object->is_hidden) && $object->is_hidden == 1) :?> selected="selected" <?php endif; ?>>Hiện</option>
                                        <option value="2" <?php if (isset($object->is_hidden) && $object->is_hidden == 2) :?> selected="selected" <?php endif; ?>>Ẩn</option>
                                    </select>
                                </td>
                            </tr>

                        </table>
                    </div>
                </div>
                <div class="form_block">
                    <div class="block_header">
                        Thông tin SEO
                    </div>
                    <div class="block_content">
                        <table cellpadding="0px" cellspacing="0px">
                            <tr>
                                <td class="frm_label">Tiêu đề(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input" name="data[meta_title]" value="<?php echo get_field($object, 'meta_title'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Từ khóa(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input" name="data[meta_keywords]" value="<?php echo get_field($object, 'meta_keywords'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Mô tả(*)</td>
                                <td class="frm_field">
                                    <textarea class="std_editor"  name="data[meta_description]"><?php echo get_field($object, 'meta_description'); ?></textarea>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="clearfix auto_height mb_10 mt_10">
                    <button class="gray_btn " type="button" onclick="window.location = '<?php echo site_url('admin/medical/object/index', true); ?>'"><span>Về danh sách</span></button>
                    <button class="gray_btn" type="button" onclick="admin_medical_object.submit_object();"><span>Lưu lại</span></button>
                    <button class="gray_btn" type="reset"><span>Nhập lại</span></button>
                    <?php if (isset($object->id) && $has_privilege_delete) :?>
                    <button class="gray_btn delete_btn" type="button" action="<?php echo site_url('admin/medical/object/delete/id/' . $object->id, true); ?>" message="Bạn muốn xóa đối tượng này?" onclick="btn_util.active_delete(this)"><span>Xóa đối tượng</span></button>
                    <?php endif; ?>
                </div>
            </form>
        </div>
    </div>


<div class="clearfix"></div>
<script type="text/javascript">
    $("#object_is_active").val("<?php echo get_field($object, 'is_active'); ?>");
    function create_new(){
        $('#active_tab_edit a').trigger('click');
        $("#entity_id").val(0);
        $("#frm_object_edit input[type='text']").val("");
        $(".std_editor").text("");
    }
</script>
<script type="text/javascript" src="<?php echo BASE_URL; ?>js/admin/medical/object/function.js"></script>